//
//author: Cody Sorgenfrey
//

function slide(newViewId, back, two){
	
	document.getElementById("sermons").style.webkitTransform="translateX(120%)";
	
	document.getElementById("sermons").style.MozTransform="translateX(120%)";

	document.getElementById("sermons").style.OTransform="translateX(120%)";
	
	if (two == "TRUE") {
	
		setTimeout(function(){
		
			document.getElementById("stayConnectedBlock").style.webkitTransform="translateX(-120%)";
			
			document.getElementById("stayConnectedBlock").style.MozTransform="translateX(-120%)";
			
			document.getElementById("stayConnectedBlock").style.OTransform="translateX(-120%)";
			
		}, 200);
	
	}
	
	refreshView (newViewId, back, two);
	
	setTimeout(function(){
				
		if (two == "TRUE") {
		
			document.getElementById("stayConnectedBlock").style.webkitTransform="translateX(0px)";
			
			document.getElementById("stayConnectedBlock").style.MozTransform="translateX(0px)";
			
			document.getElementById("stayConnectedBlock").style.OTransform="translateX(0px)";
			
		}
		
		setTimeout(function(){
		
			document.getElementById("sermons").style.webkitTransform="translateX(0px)";
		
			document.getElementById("sermons").style.MozTransform="translateX(0px)";
			
			document.getElementById("sermons").style.OTransform="translateX(0px)";
					
		}, 200);
	}, 2000);
}

function refreshView (newViewId, back, two) {
	
	if (back == "TRUE"){
		
		setTimeout(function(){

			document.getElementById("sermon"+newViewId).style.display = "none";

			document.getElementById("recents").style.display = "block";
									
			if (two == "TRUE"){ 
				
				document.getElementById("leftSermon"+newViewId).style.display = "none";
				
				document.getElementById("stayConnected").style.display = "block";
				
			}
			
		}, 1500);
	}
	else {
		
		setTimeout(function(){
		
			document.getElementById("recents").style.display = "none";

			document.getElementById("sermon"+newViewId).style.display = "block";

			if (two == "TRUE") {
				
				document.getElementById("stayConnected").style.display = "none";
					
				document.getElementById("leftSermon"+newViewId).style.display = "block";
			}
			
		}, 1500);
	}
}

function slidePhone(newViewId, back, two){
	
	document.getElementById("sermons").style.webkitTransform="translateX(120%)";
	
	document.getElementById("sermons").style.MozTransform="translateX(120%)";
	
	document.getElementById("sermons").style.OTransform="translateX(120%)";
	
	if (two == "TRUE") {
	
		setTimeout(function(){
		
			document.getElementById("plainlist").style.webkitTransform="rotateZ(-120deg)";
			
			document.getElementById("plainlist").style.MozTransform="rotateZ(-120deg)";
			
			document.getElementById("plainlist").style.OTransform="rotateZ(-120deg)";
			
		}, 200);
	
	}
	
	refreshViewPhone (newViewId, back, two);
	
	setTimeout(function(){
				
		if (two == "TRUE" && back == "TRUE") {
		
			document.getElementById("plainlist").style.webkitTransform="rotateZ(0deg)";
			
			document.getElementById("plainlist").style.MozTransform="rotateZ(0deg)";
			
			document.getElementById("plainlist").style.OTransform="rotateZ(0deg)";
			
		}
		
		setTimeout(function(){
		
			document.getElementById("sermons").style.webkitTransform="translateX(0px)";
		
			document.getElementById("sermons").style.MozTransform="translateX(0px)";
			
			document.getElementById("sermons").style.OTransform="translateX(0px)";
					
		}, 200);

	
	}, 2000);
}

function refreshViewPhone (newViewId, back, two) {
	
	if (back == "TRUE"){
		
		setTimeout(function(){

			document.getElementById("recents").style.display = "block";
			
			document.getElementById("sermon"+newViewId).style.display = "none";
									
			if (two == "TRUE"){ 
								
				document.getElementById("plainlist").style.display = "block";
				
			}
			
		}, 1500);
	}
	else {
		
		setTimeout(function(){
		
			document.getElementById("recents").style.display = "none";

			document.getElementById("sermon"+newViewId).style.display = "block";

			if (two == "TRUE") {
				
				document.getElementById("plainlist").style.display = "none";
			}
			
		}, 1500);
	}
}

